#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int** array2D;
	//动态分配空间
	array2D = new int* [n];

	for (int i = 0; i < n; i++)
	{
		array2D[i] = new int[n];
		for (int j = 0; j < n; j++)
		{
			cin >> array2D[i][j];
		}
	}
	int sum = 0;
	double average;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			sum += array2D[i][j];
		}
	}
	average = sum*1.0 / (n * n);
	bool flag = 0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (array2D[i][j] > average)
			{
				cout << array2D[i][j] << " " << i << " " << j << endl;
				flag = 1;
			}
		}
	}
	if (flag == 0)
	{
		cout << 0;
	}
	//释放
	for (int i = 0; i < n; i++)
	{
		delete[] array2D[i];
	}
	delete array2D;
	return 0;
}